bitkeeper revision 1.1108.1.18 (410132d727sJm8mjzG0hN7Txe_COkg)
authormjw@wray-m-3.hpl.hp.com <mjw@wray-m-3.hpl.hp.com>
Fri, 23 Jul 2004 15:46:31 +0000 (15:46 +0000)
committermjw@wray-m-3.hpl.hp.com <mjw@wray-m-3.hpl.hp.com>
Fri, 23 Jul 2004 15:46:31 +0000 (15:46 +0000)
Fix problem where a failed console connect terminates an existing
console connection.

tools/python/xen/xend/server/console.py

index b3231beb1283a8737bc526f2221721ef5b2ddeeb..9221600bdb24500c1a6c7a43a1112be12daf3a1b 100755 (executable)
@@ -57,7 +57,7 @@ class ConsoleProtocol(protocol.Protocol):
                  self.idx, str(self.addr[0]), str(self.addr[1]))
         eserver.inject('xend.console.disconnect',
                        [self.idx, self.addr[0], self.addr[1]])
-        self.controller.disconnect()
+        self.controller.disconnect(conn=self)
 
     def loseConnection(self):
         self.transport.loseConnection()
@@ -211,9 +211,10 @@ class ConsoleController(controller.Controller):
         self.handleOutput()
         return 0
 
-    def disconnect(self):
+    def disconnect(self, conn=None):
         """Disconnect the TCP connection to the console.
         """
+        if conn and conn != self.conn: return
         if self.conn:
             self.conn.loseConnection()
         self.addr = None